import request from '@/utils/request'


//【工作流相关总数统计】查询我的工作流统计
export function queryMyWorkflowRecordTotalStatistics() {
  return request({
    url: 'sysAdmin/workflowRecord/queryMyWorkflowRecordTotalStatistics',
    method: 'post'
  })
}

//【我发起】分页查询我发起的工作流
export function queryMyWorkflowRecordPageResList(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryMyWorkflowRecordPageResList',
    method: 'post',
    data: JSON.stringify(data)
  })
}



//【抄送我的】分页查询抄送我的工作流
export function queryCopyWorkflowRecordPageResList(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryCopyWorkflowRecordPageResList',
    method: 'post',
    data: JSON.stringify(data)
  })
}

//【我已办】分页查询我已办的工作流
export function queryFinishedWorkflowRecordPageResList(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryFinishedWorkflowRecordPageResList',
    method: 'post',
    data: JSON.stringify(data)
  })
}



//【我待办】分页查询我待办的工作流
export function queryToDoWorkflowRecordPageResList(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryToDoWorkflowRecordPageResList',
    method: 'post',
    data: JSON.stringify(data)
  })
}

//【我在办】分页查询我待办的工作流
export function queryInProcessWorkflowRecordPageResList(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryInProcessWorkflowRecordPageResList',
    method: 'post',
    data: JSON.stringify(data)
  })
}


//【保存】发起工作流
export function saveWorkflowRecord(data) {
  return request({
    url: 'sysAdmin/workflowRecord/saveWorkflowRecord',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在发起中...",
    data: JSON.stringify(data)
  })
}

//【修改】发起工作流
export function updateWorkflowRecord(data) {
  return request({
    url: 'sysAdmin/workflowRecord/updateWorkflowRecord',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在修改中...",
    data: JSON.stringify(data)
  })
}


//【提交】发起工作流
export function submitWorkflowRecord(data) {
  return request({
    url: 'sysAdmin/workflowRecord/submitWorkflowRecord',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在提交中...",
    data: JSON.stringify(data)
  })
}



//【删除】删除未提交的流程
export function deleteWorkflowRecordByRecordId(data) {
  return request({
    url: 'sysAdmin/workflowRecord/deleteWorkflowRecordByRecordId',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在删除中...",
    data: JSON.stringify(data)
  })
}


//【初始编辑明细】根据流程记录id查询查询流程记录编辑初始值明细
export function queryMyWorkflowRecordDetailsEditResByRecordId(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryMyWorkflowRecordDetailsEditResByRecordId',
    method: 'post',
    data: JSON.stringify(data)
  })
}




//【获取工作流实例图片】获取工作流实例图片
export function queryWorkflowRecordReadImage(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryWorkflowRecordReadImage',
    method: 'post',
    data: JSON.stringify(data)
  })
}

//【查询可退回的节点】根据任务id获取可回退的任何集合
export function queryReturnWorkflowTaskListByTaskId(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryReturnWorkflowTaskListByTaskId',
    method: 'post',
    data: JSON.stringify(data)
  })
}

//【流程历史流转记录】根据流程记录id查询流程历史流转记录
export function queryWorkflowHistoryRecordPageResLisByRecordId(data) {
  return request({
    url: 'sysAdmin/workflowRecord/queryWorkflowHistoryRecordPageResLisByRecordId',
    method: 'post',
    data: JSON.stringify(data)
  })
}

//【取消申请】根据流程记录id取消申请
export function cancelWorkflowApplyByRecordId(data) {
  return request({
    url: 'sysAdmin/workflowRecord/cancelWorkflowApplyByRecordId',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在取消中...",
    data: JSON.stringify(data)
  })
}

//【完成任务】【办理任务】根据任务id完成办理任务
export function completeWorkflowTask(data) {
  return request({
    url: 'sysAdmin/workflowRecord/completeWorkflowTask',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在办理中...",
    data: JSON.stringify(data)
  })
}

//【认领任务】认领/签收任务
export function claimWorkflowTask(data) {
  return request({
    url: 'sysAdmin/workflowRecord/claimWorkflowTask',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在认领签收中...",
    data: JSON.stringify(data)
  })
}


//【转办任务】转办任务
export function transferWorkflowTask(data) {
  return request({
    url: 'sysAdmin/workflowRecord/transferWorkflowTask',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在转办中...",
    data: JSON.stringify(data)
  })
}




//【委派任务】委派任务
export function delegateWorkflowTask(data) {
  return request({
    url: 'sysAdmin/workflowRecord/delegateWorkflowTask',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在委派中...",
    data: JSON.stringify(data)
  })
}



//【终止流程】终止流程
export function stopWorkflowTask(data) {
  return request({
    url: 'sysAdmin/workflowRecord/stopWorkflowTask',
    method: 'post',
    loadingFlag:true,
    loadingMsg:"正在终止中...",
    data: JSON.stringify(data)
  })
}
